package Game;

public class Finger {
    public int pan() {
        int b=0;
        System.out.println("高楼大厦有小偷");
        Computer computer = new Computer();
        Player player = new Player();
        for (int i = 0; i < 10; i++) {
            System.out.println((i+1) + "楼");
            String str1 = computer.fist();
            String str2 = player.fist();
             b += fraction(str1, str2);
            System.out.println(b);
        }
        return b;
    }

    public int fraction(String str1, String str2) {
        int a = 0;
        if (str1.equals("石头")) {
            if (str2.equals("石头")) {
                a += 1;
            } else if (str2.equals("剪刀")) {
                a -= 1;
            } else if (str2.equals("布")) {
                a += 3;
            }
        } else if (str1.equals("剪刀")) {
            if (str2.equals("石头")) {
                a += 3;
            } else if (str2.equals("剪刀")) {
                a += 1;
            } else if (str2.equals("布")) {
                a -= 1;
            }
        } else if (str1.equals("布")) {
            if (str2.equals("石头")) {
                a -= 1;
            } else if (str2.equals("剪刀")) {
                a += 3;
            } else if (str2.equals("布")) {
                a += 1;
            }
        }
        return a;
    }
    public void result(){
        Finger finger = new Finger();
        int d=finger.pan();
        if(d<0){
            System.out.println("垃圾");
        }else if(d<10){
            System.out.println("也就一般");
        }else if(d>=10){
            System.out.println("真棒");
        }
    }

    public static void main(String[] args) {
        Finger finger = new Finger();
        finger.result();
    }

}
